package com.aaa.controller;

import com.aaa.entity.Brand;
import com.aaa.service.impl.BrandServiceimpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("brand")
public class BrandController {
    @Resource
    BrandServiceimpl brandServiceimpl;

    @RequestMapping("find")
    public List<Brand> find(){
        return brandServiceimpl.find();
    }
    @RequestMapping("add")
    @ResponseBody
    public int add(Brand brand){
        return brandServiceimpl.add(brand);
    }

    @RequestMapping("update")
    @ResponseBody
    public int update(Brand brand){
        return brandServiceimpl.update(brand);
    }

    @RequestMapping("delete")
    @ResponseBody
    public int delete(Integer id){
        return brandServiceimpl.delete(id);
    }

}
